class AddIndexes < ActiveRecord::Migration
  def self.up
    add_index 'writeboards', 'project_id'
    add_index 'reqs', 'project_id'
    add_index 'reqs', 'doc_id'
    add_index 'reqs', 'sprint_id'
    add_index 'notes', 'task_id'
    add_index 'notes', 'user_id'
    add_index 'req_docs', 'project_id'
    add_index 'projects', 'writeboad_id'
    add_index 'action_logs', 'session_id'
    add_index 'action_logs', 'user_id'
    add_index 'action_logs', 'project_id'
    add_index 'tasks', 'project_id'
    add_index 'tasks', 'user_id'
    add_index 'tasks', 'task_id'
    add_index 'req_rels', 'req_from_id'
    add_index 'req_rels', 'req_to_id'
    add_index 'req_versions', 'project_id'
    add_index 'req_versions', 'doc_id'
    add_index 'req_versions', 'sprint_id'
    add_index 'invitations', 'user_id'
    add_index 'invitations', 'invited_id'
    add_index 'invitations', 'project_id'
    add_index 'req_doc_dependances', 'upper_id'
    add_index 'req_doc_dependances', 'lower_id'
    add_index 'taggings', 'tag_id'
    add_index 'taggings', 'taggable_id'
    add_index 'calendars', 'project_id'
    add_index 'calendars', 'user_id'
  end

  def self.down
    remove_index 'writeboards', 'project_id'
    remove_index 'reqs', 'project_id'
    remove_index 'reqs', 'doc_id'
    remove_index 'reqs', 'sprint_id'
    remove_index 'notes', 'task_id'
    remove_index 'notes', 'user_id'
    remove_index 'req_docs', 'project_id'
    remove_index 'projects', 'writeboad_id'
    remove_index 'action_logs', 'session_id'
    remove_index 'action_logs', 'user_id'
    remove_index 'action_logs', 'project_id'
    remove_index 'tasks', 'project_id'
    remove_index 'tasks', 'user_id'
    remove_index 'tasks', 'task_id'
    remove_index 'req_rels', 'req_from_id'
    remove_index 'req_rels', 'req_to_id'
    remove_index 'req_versions', 'project_id'
    remove_index 'req_versions', 'doc_id'
    remove_index 'req_versions', 'sprint_id'
    remove_index 'invitations', 'user_id'
    remove_index 'invitations', 'invited_id'
    remove_index 'invitations', 'project_id'
    remove_index 'req_doc_dependances', 'upper_id'
    remove_index 'req_doc_dependances', 'lower_id'
    remove_index 'taggings', 'tag_id'
    remove_index 'taggings', 'taggable_id'
    remove_index 'calendars', 'project_id'
    remove_index 'calendars', 'user_id'
  end
end

